package cn.syy.feign;

import cn.syy.constants.Constants;
import cn.syy.fallback.AppLoginFeignClientFallbackFactory;

import cn.syy.pojo.param.RegisterSaveLoginParam;
import cn.syy.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * value：注册到nacos的服务名
 * path：访问路由
 * contextId：唯一id，防止名字重复
 * fallbackFactory：回退工厂，调用失败时候执行
 */
@FeignClient(value = Constants.Remote.SERVICE_UAA,path = "/app/login",contextId = "AppLoginFeignClient",fallbackFactory = AppLoginFeignClientFallbackFactory.class)
public interface AppLoginFeignClient {
    /**
     * 调用sava方法的feign接口
     * @param registerSaveLoginParam
     * @return
     */
    @PostMapping
     R<Void> save(@RequestBody RegisterSaveLoginParam registerSaveLoginParam);
}
